/**
 * 
 */
package ro.dta.idbi.model;

import uk.ac.bbk.dcs.automed.qproc.iql.ASG;
import uk.ac.bbk.dcs.automed.qproc.iql.ASGResult;

/**
 * Query result, used to store the result of an IQL query
 * 
 * @author Tudor Dobrila
 * 
 */
public class QueryResult {

	/**
	 * Abstract Syntax Graph of the query
	 */
	private final transient ASG asg;

	/**
	 * Total execution time of the query in seconds
	 */
	private final transient double executionTime;

	/**
	 * Abstract Syntax Graph result of the query
	 */
	private transient ASGResult result;

	/**
	 * QueryResult class constructor
	 * 
	 * @param asg
	 *            Abstract Syntax Graph of the query
	 * @param executionTime
	 *            Total execution time of the query in seconds
	 */
	public QueryResult(final ASG asg, final ASGResult result, final double executionTime) {
		this.asg = asg;
		this.executionTime = executionTime;
		this.result = result;
	}

	/**
	 * @return Abstract Syntax Graph of the query
	 */
	public ASG getAsg() {
		return asg;
	}

	/**
	 * @return Total execution time of the query in seconds
	 */
	public double getExecutionTime() {
		return executionTime;
	}

	/**
	 * @return The new result associated with the query result
	 */
	public ASGResult getResult() {
		return result;
	}

	/**
	 * @param result
	 *            The result associated with the query result
	 */
	public void setResult(ASGResult result) {
		this.result = result;
	}
}
